package cn.zy.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;



import cn.zy.bean.User;
import cn.zy.service.UserService;

@Controller
@Scope("prototype")
public class RegisterAction {
	@Resource(name ="userServiceI")
	private UserService userservice;

	private User user;


	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
    public String registerUI(){
    	return "regui";
    }
	public String addRegisterUser() {

		if(userservice.save(user)){
			System.out.println("ע��ɹ���");
		}else{
			System.out.println("ע��ʧ�ܣ�������Ѿ�ע�ᣡ");
		}
		return "addUser";
	}

	public String execute() {
		System.out.println("��ã�");
		return "message";
	}
}
